/**   
 * Copyright © 2016 北京之洲科技有限责任公司. All rights reserved.
 * 
 * @Title: CarInfoDaoOfAutoHome.java 
 * @Prject: carfactory
 * @Package: com.zizo.autohome.carinfo.dao 
 * @Description: 
 * @author: Alexis  
 * @email heyan0227@outlook.com
 * @date: 2016年8月11日 下午4:44:42 
 * @version: V1.0   
 */
package com.zizo.autohome.carinfo.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

import com.zizo.autohome.carinfo.bean.CarInfo;
import com.zizo.core.T;
import com.zizo.util.ConnectionPool;

/**
 * @ClassName: CarInfoDaoOfAutoHome
 * @Description:
 * @author: Alexis
 * @date: 2016年8月11日 下午4:44:42
 */
public class CarInfoDaoOfAutoHome {
	private Connection currConn = ConnectionPool.getConnection();

	/**
	 * @Title:CarInfoDaoOfAutoHome
	 * @Description:
	 * @param currConn
	 */
	public CarInfoDaoOfAutoHome(Connection currConn) {
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: getIDs
	 * 
	 * @Description:
	 * 
	 * @return
	 * 
	 * @see com.zizo.core.DAOInterface#getIDs()
	 */
	public List<String> getIDs() {
		return null;
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: insertData
	 * 
	 * @Description:
	 * 
	 * @param t
	 * 
	 * @return
	 * 
	 * @see com.zizo.core.DAOInterface#insertData(com.zizo.core.T)
	 */
	public int insertData(T t) {
		PreparedStatement ps = null;
		String sql = "INSERT INTO autohome_other.other_core_brand(brand_brdid,brand_name,brand_firstletter,oem_id,oem_name,model_cid,model_name,model_time) VALUES(?,?,?,?,?,?,?,NOW())";
		CarInfo carinfo = (CarInfo) t;
		try {
			ps = currConn.prepareStatement(sql);
			ps.setInt(1, carinfo.getBrand_id());
			ps.setString(2, carinfo.getBrand_name());
			ps.setString(3, carinfo.getBrand_firstletter());
			ps.setInt(4, carinfo.getOem_id());
			ps.setString(5, carinfo.getOem_name());
			ps.setInt(6, carinfo.getCar_id());
			ps.setString(7, carinfo.getCar_name());
			ps.executeUpdate();
		} catch (SQLException e) {
		}
		return 0;
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: updateTime
	 * 
	 * @Description:
	 * 
	 * @param type
	 * 
	 * @param id
	 * 
	 * @see com.zizo.core.DAOInterface#updateTime(java.lang.String,
	 * java.lang.String)
	 */
	public void updateTime(String type, String id) {

	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: getTables
	 * 
	 * @Description:
	 * 
	 * @return
	 * 
	 * @see com.zizo.core.DAOInterface#getTables()
	 */
	public List<String> getTables() {
		// TODO Auto-generated method stub
		return null;
	}

	/*
	 * (non Javadoc)
	 * 
	 * @Title: insertError
	 * 
	 * @Description:
	 * 
	 * @param t
	 * 
	 * @return
	 * 
	 * @see com.zizo.core.DAOInterface#insertError(com.zizo.core.T)
	 */
	public int insertError(T t) {
		return 0;
	}

}
